package com.etong.test;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;

public class JUnitTestServiceImplBase {
	static protected final Logger logger = LoggerFactory
			.getLogger(JUnitTestServiceImplBase.class);
	static protected ApplicationContext applicationContext = null;

	static {
		applicationContext = new ClassPathXmlApplicationContext(
				"dubbo/intercity-provider.xml");
		logger.debug("Init config:dubbo/intercity-provider.xml");
	}

	<T> T getService(Class<T> clazz) {
		return applicationContext.getBean(clazz);
	}

	protected Integer getNowTimestamp() {
		return (int) (System.currentTimeMillis() / 1000);
	}
}
